package cn.itcast.service.user.impl;

import cn.itcast.mapper.SysUserMapper;
import cn.itcast.model.SysUserExample;
import cn.itcast.service.user.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

/**
 * @Author: zhaojie
 * @Date: Created in 14:13 2018/8/9
 * @Description:
 */
@Service("loginServiceImpl")
public class UserLoginServiceImpl implements UserLoginService {


    @Autowired
    @Qualifier("sysUserMapper")
    private SysUserMapper sysUserMapper;

    @Override

    public int checkUserInfo(String username, String password) {
        SysUserExample sysUserExample=new SysUserExample();
        sysUserExample.createCriteria().andUsernameEqualTo(username).andPasswordEqualTo(password);
        int i = sysUserMapper.countByExample(sysUserExample);
        return i;
    }
}
